package com.daniel.design.pattern.adapter.object_adapter;

/**
 * @ClassName SdAdapterTf
 * @Description 对象适配器类
 * @Author Daniel
 * @Version V1.0.0
 */
public class SdAdapterTf  implements SdCard {
    private TfCard tfCard;

    public SdAdapterTf(TfCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSd() {
        System.out.println("适配器中读取TF卡数据");
        return tfCard.readTf();
    }

    @Override
    public void writeSd(String data) {
        System.out.println("适配器中写入TF卡数据");
        tfCard.writeTf(data);
    }
}
